/**
* @Date 2020/5-9
* @author sheyurong
* @description 项目配置
*/
const path = require('path')

const resolve = dir => {
  return path.join(__dirname, dir)
}

module.exports = {
  // 打包输出目录
  //   outputDir: 'dist',
  // 项目基础路径
  publicPath: './',
  // 如果你不需要使用eslint，把lintOnSave设为false即可
  lintOnSave: false,

  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src')) // key,value自行定义，比如.set('@@', resolve('src/components'))
    config.module
      .rule('swf')
      .test(/\.swf$/)
      .use('url-loader')
      .loader('url-loader')
      .options({
        limit: 10000,
        publicPath: '../../'
      })
  },
  // 打包时不生成source map
  productionSourceMap: true,
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [path.resolve(__dirname, './src/assets/css/global-variable.less')]
    }
  }
}
